#include <REGX52.H>
/**
 * 按照如下顺序流动
 * 1357
 * 8642
 * 1357
 */
void delay_ms(unsigned int ms)
{
    unsigned int i, j;
    for (i = 0; i < ms; i++)
    {
        for (j = 0; j < 123; j++)
            ;
    }
}

void main()
{
    unsigned char i;
    P2 = 0xFF;
    while (1)
    {
        for (i = 0; i < 4; i++)
        {
            P2 = ~(0x01 << (i * 2));
            delay_ms(200);
        }

        for (i = 0; i < 4; i++)
        {
            P2 = ~(0x80 >> (i * 2));
            delay_ms(200);
        }
    }
}